<template>
    <div style="background: #f96388;position: relative;">
      <div class="nag">
        <div class="hidden-box">
          <div v-for="(item ,index) of ShowBoxList[onmouseIndex]" :key="index+'hidden-box'" class="hidden-box-ground">
            <h2>{{item.title}}</h2>
            <ul>
              <li v-for="(ins, insdex) of item.item" :key="insdex + 'li'">
                {{ins}}
              </li>
            </ul>
          </div>
        </div>
        <ul class="nav-list-left">
          <!-- 这是左边的列表 -->
          <li class="nav-list-left-head">
            <h2 class="nav-list-left-title">全部分类</h2>
            <span class="iconfont " style="float: right;font-size: 16px;line-height: 40px;color: #ccc;">&#xe60e;</span>
          </li>
          <li class="nav-list-left-list">
            <h3 class="nav-list-left-list-title">女装</h3>
            <ul class="nav-list-left-list-title-box">
              <li>连衣裙</li>
              <li>T恤</li>
              <li>时尚套装</li>
              <li>衬衫</li>
              <li>牛仔裤</li>
              <li>休闲裤</li>
            </ul>
          </li>
          <li class="nav-list-left-list">
            <h3 class="nav-list-left-list-title">男装</h3>
            <ul class="nav-list-left-list-title-box">
              <li>T恤</li>
              <li>休闲裤</li>
              <li>牛仔裤</li>
              <li>衬衫</li>
              <li>Polo衫</li>
              <li>运动套装</li>
            </ul>
          </li>
          <li class="nav-list-left-list">
            <h3 class="nav-list-left-list-title">鞋</h3>
            <ul class="nav-list-left-list-title-box">
              <li>低帮鞋</li>
              <li>男低帮鞋</li>
              <li>女拖鞋</li>
              <li>凉鞋</li>
              <li>低帮帆布</li>
              <li>靴子</li>
            </ul>
          </li>
          <li class="nav-list-left-list">
            <h3 class="nav-list-left-list-title">孕妇装</h3>
            <ul class="nav-list-left-list-title-box">
              <li>连衣裙</li>
              <li>套装</li>
              <li>孕妇裤</li>
              <li>哺乳衣</li>
              <li>T恤</li>
              <li>卫衣绒衫</li>
            </ul>
          </li>
        </ul>
        
        <ul class="nav-list-header">
          <!-- 这是头部导航 -->
          <li class="nav-list-actived">首页</li>
          <li>市场导航</li>
          <li>档口排行榜</li>
          <li>每日新款</li>
          <li>实力质造</li>
          <li>七日热款</li>
          <li>实体代发</li>
          <li>视频专区</li>
          <li>外贸爆款</li>
          <li>秋冬爆款</li>
          <li>服务市场</li>
        </ul>
        <div class="nav-bottom-box">
          <div class="nav-swiper">
            
            <!-- 这是大轮播 -->
            <img :src="BigImgUrl" alt="" width="100%">
          </div>
          <div class="nav-bottom-box-center">
            <!-- 这是小轮播 -->
            <img src="/static/img_head_right/swiper_head_1.jpg" alt="" width="100%">
          </div>
          <div class="nav-bottom-box-right">
            <!-- 这是登陆盒子 -->
            <img src="/static/img_head_right/swiper_head_1.jpg" alt="" width="100%">
          </div>
        </div>
      </div>
      <box-one></box-one>
      <box-two></box-two>
      <box-tre></box-tre>
    </div>
    
</template>

<script>
import BoxOne from "./components/BoxOne"
import BoxTwo from './components/BoxTwo'
import BoxTre from './components/BoxTre'
import { setInterval, clearInterval } from 'timers';
export default {
  name: "IndexOne",
  components: {
    BoxOne,
    BoxTwo,
    BoxTre
  },
  data(){
    return{
      "BigImgUrl": "/static/img_head/swiper_big_1.jpg",
      "BigTimer": '',
      "BigImgUrlList": ["/static/img_head/swiper_big_1.jpg","/static/img_head/swiper_big_2.jpg"],
      "onmouseIndex": 0,
      "showBoxDIS": [],
      "ShowBoxList": ["",
      [{"title": "上衣/外套","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]},{"title": "上衣/外套","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]}],
      [{"title": "上衣/外套","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]},{"title": "上衣/外套","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]}],
      [{"title": "女鞋","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]},{"title": "上衣/外套","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]}],
      [{"title": "孕妇装","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]},{"title": "上衣/外套","item":["T恤","时尚套装","衬衫","蕾丝雪纺","短外套","大码连衣裙","休闲运动","大码女装","毛针织衫","背心吊带","风衣","卫衣绒衫","情侣装","中老年连衣裙","毛衣","马夹","旗袍","孕妇装","西装","羽绒服"]}]
      ]
      
    } 
  },
  mounted(){
    clearInterval(this.BigTimer);
    let BigImgIndex = 0
    let len = this.BigImgUrlList.length;
    this.BigTimer = setInterval(() => {
      BigImgIndex++;
      if(BigImgIndex >= len)BigImgIndex = 0;
      this.BigImgUrl = this.BigImgUrlList[BigImgIndex];
    },2000);
    const $Li = $(".nav-list-left-list");
    const box = document.getElementsByClassName("hidden-box")[0];
    let isHidden_li = true;
    let isHidden_box = true;
    const This = this;
    $Li.mouseenter(function() {
      $(box).addClass("hidden-box-actived");
      $(this).css({
        "border-right": "0px"
      }).siblings().css({
        "border-right": "1px solid #ccc"
      })
      This.onmouseIndex = $(this).index()*1;
      isHidden_li = false;
    })
    $Li.mouseleave(() => {
      isHidden_li = true;
      if(isHidden_box && isHidden_li){
        $(box).removeClass("hidden-box-actived");
      }
    })
    box.onmouseenter = function(){
      $(this).addClass("hidden-box-actived");
      isHidden_box = false;
    }
    box.onmouseleave = function(){
      isHidden_box = true;
      if(isHidden_box && isHidden_li){
        $(this).removeClass("hidden-box-actived");
        $Li.css({
          "border-right": "0px"
        })
      }
    }

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="stylus" scoped>
  .nag
    position: relative;
    margin: 0 auto;
    display: flex;
    width: 1192px;
    height: 40px;
    background: #f96388;
    // 这是左边列表开始
    .nav-list-left
      position: relative;
      z-index: 999;
      box-sizing: border-box;
      width: 190px;
      height: 366px;
      background: #fff;
      border-top: 1px solid #f96388;
      .nav-list-left-head
        padding: 0 14px;
        height: 40px;
        .nav-list-left-title
          float: left;
          font-size: 14px;
          color: #333;
          line-height: 40px;
          text-align: left;
      .nav-list-left-list
        box-sizing: border-box;
        padding: 0 14px;
        border-bottom : 1px dotted #ccc;
        .nav-list-left-list-title
          height: 30px;
          line-height: 30px;
          text-align: left;
          cursor: pointer;
        .nav-list-left-list-title:hover
          color: #f96388;
        .nav-list-left-list-title-box
          overflow: hidden;
        .nav-list-left-list-title-box>li
          float: left;
          width: 33.3%;
          height: 25px;
          font-size: 12px;
          line-height: 25px;
          text-align: left;
          cursor: pointer;
        .nav-list-left-list-title-box>li:hover 
          color: #f96388;   
    .hidden-box
      position: absolute;
      display: flex;
      box-sizing: border-box;
      justify-content: space-around;
      padding-left: 190px;
      top: 42px;
      left: 0;
      z-index: 3;
      width: 190px;
      height: 324px;
      background: #fff;
      transition: .5s;
      overflow: hidden;
      .hidden-box-ground
      .hidden-box-ground>h1
        height: 34px;
        line-height: 34px;
        font-size: 14px;
        border-bottom: 1px dotted #ccc;
      .hidden-box-ground>ul
        width: 242px;
        display: flex;
        flex-flow: row wrap;
      .hidden-box-ground>ul>li
        text-align: left;
        width: 50%;
        font-size: 12px;
        line-height: 25px;
    .hidden-box-actived
      width: 990px;
    // 这是左边列表结束

    // 这是头部列表开始
    .nav-list-header
      padding: 0 10px;
      flex: 1;
      height: 100%;
      background: #f96388;
      overflow: hidden;
      .nav-list-actived
        border-top: 1px solid #f96388 !important;
        background: #fff !important;
        color: #f96388 !important;
    .nav-list-header>li
      float: left;
      padding: 0 10px;
      width: 70px;
      height: 100%;
      color: #fff;
      font-size: 14px;
      line-height: 40px;
      text-align: center;
      cursor: pointer;
    // 这是头部列表结束

    // 这是轮播部分开始
    .nav-bottom-box
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      position: absolute;
      left: 202px;
      top: 50px;
      width: 990px;
      height: 316px;
      .nav-swiper
        width: 572px;
        height: 100%;
      .nav-bottom-box-center
        width: 200px;
        height: 100%;
        background: #ccc;
      .nav-bottom-box-right
        width: 200px;
        height: 100%;

</style>
